package com.pureut.production.controller;


import com.pureut.common.core.web.controller.BaseController;
import com.pureut.common.core.web.domain.AjaxResult;
import com.pureut.common.core.web.page.TableDataInfo;
import com.pureut.production.domain.dto.GroupManagementDetailViewDto;
import com.pureut.production.domain.vo.GroupManagementDetailVo;
import com.pureut.production.service.GroupManagementDetailService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: CM
 * @date: 2023/2/7  16:35
 */
@RestController
@RequestMapping("/groupDetail")
public class GroupManagementDetailController extends BaseController {

    @Resource
    private GroupManagementDetailService groupManagementDetailService;

    /**
     * 班组信息列表查询
     */
    @GetMapping("/list")
    public TableDataInfo getList(Long id) {
        startPage();
        //查询班组信息列表明细
        List<GroupManagementDetailViewDto> list = groupManagementDetailService.getList(id);
        return getDataTable(list);
    }

    /**
     * 是否启用
     */
    @PutMapping("/isStart")
    public AjaxResult isStart(@RequestBody GroupManagementDetailVo groupManagementDetailVo) {
        return toAjax(groupManagementDetailService.isStart(groupManagementDetailVo));
    }

}
